package com.hantang.web.json.ds;


import com.hantang.web.data.NewMessageData;


public class NewMessage {

	private long id;
	private long sequence; // used for ordering
	private long createDate;
	private  String title;
	private String content;
	private short highlight;//[0,1,-1]
	private String remarks;
	
	public static NewMessage convertData2Json(NewMessageData data)
	{
		if(data == null){
			return null;
		}
		NewMessage json = new NewMessage();
		json.setContent(data.getContent());
		if(data.getCreateDate() != null){
			json.setCreateDate(data.getCreateDate().getTime());
		}
		json.setHighlight(data.getHighlight());
		json.setId(data.getId());
		json.setRemarks(data.getRemarks());
		json.setSequence(data.getSequence());
		json.setTitle(data.getTitle());
		return json;
	}
	
	public long getId() {
		return id;
	}
	public void setId(long id) {
		this.id = id;
	}
	public long getSequence() {
		return sequence;
	}
	public void setSequence(long sequence) {
		this.sequence = sequence;
	}
	public long getCreateDate() {
		return createDate;
	}
	public void setCreateDate(long createDate) {
		this.createDate = createDate;
	}
	public String getTitle() {
		return title;
	}
	public void setTitle(String title) {
		this.title = title;
	}
	public String getContent() {
		return content;
	}
	public void setContent(String content) {
		this.content = content;
	}
	public short getHighlight() {
		return highlight;
	}
	public void setHighlight(short highlight) {
		this.highlight = highlight;
	}
	public String getRemarks() {
		return remarks;
	}
	public void setRemarks(String remarks) {
		this.remarks = remarks;
	}

	
	
}
